package com.xbongbong.saas.service;

import com.xbongbong.paas.field.FieldAttrEntity;
import com.xbongbong.paas.pojo.dto.FixDataJobDTO;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.pro.formexplain.pojo.vo.FormExplainAddBatchVO;
import com.xbongbong.pro.script.pojo.dto.AllScriptDTO;
import com.xbongbong.pro.script.pojo.dto.FieldSetDTO;
import com.xbongbong.pro.script.pojo.dto.FixContractDTO;
import com.xbongbong.pro.script.pojo.dto.FixFormDTO;
import com.xbongbong.pro.script.pojo.dto.RepairContractBadAmountDTO;
import com.xbongbong.pro.script.pojo.dto.RepairContractDataDTO;
import com.xbongbong.pro.script.pojo.dto.RepairContractPerformanceDataDTO;
import com.xbongbong.pro.script.pojo.dto.RepairDepartmentIdBecauseApiDTO;
import com.xbongbong.pro.script.pojo.dto.RepairInvoiceAmountDTO;
import com.xbongbong.pro.script.pojo.dto.RepairInvoiceRelationMoneyDTO;
import com.xbongbong.pro.script.pojo.dto.SyncContactUserDTO;
import com.xbongbong.pro.script.pojo.dto.SyncPaymentUserDTO;
import com.xbongbong.pro.script.pojo.dto.UpdateFundManagemenExpalinstDTO;
import com.xbongbong.pro.script.pojo.dto.UpdatePaymentDataDTO;
import com.xbongbong.pro.script.pojo.dto.UpdatePaymentExplainsDTO;
import com.xbongbong.pro.script.pojo.dto.UpdateTabDTO;
import com.xbongbong.pro.script.pojo.vo.ScriptVO;

import java.util.List;

/**
 * @author haibin.zhang
 * @version v1.0
 * @date 2019/6/19 20:47
 * @since v1.0
 */
public interface RepairExplainService {
    /**
     * 修复解释 总入口
     * @param allScriptDTO
     * @return
     */
    ScriptVO repairExplain(AllScriptDTO allScriptDTO) throws XbbException;

    ScriptVO addCustomerPid(AllScriptDTO allScriptDTO) throws XbbException;

    /**
     * 临时一次性脚本
     *
     * @param allScriptDTO
     * @return
     * @throws XbbException
     */
    ScriptVO delCustomerPid(AllScriptDTO allScriptDTO) throws XbbException;
    /**
     * 修复产品里的字段解释
     * @param allScriptDTO
     * @return
     * @throws XbbException
     */
    public ScriptVO repairExplainProduct(AllScriptDTO allScriptDTO) throws XbbException ;

    ScriptVO changeExplainOrder(AllScriptDTO allScriptDTO) throws XbbException;

    Class<?> getBusinessTempClass(Integer businessType) throws XbbException;

    Class<?> getBusinessProductTempClass(Integer businessType) throws XbbException;

    ScriptVO fixForm(FixFormDTO fixFormDTO) throws XbbException;

    ScriptVO fixWorkOrderForm(FixFormDTO fixFormDTO) throws XbbException;

    ScriptVO fixDefaultForm(FixFormDTO fixFormDTO) throws XbbException;

    ScriptVO fixFormFieldDefaultName(FixFormDTO fixFormDTO) throws XbbException;

    ScriptVO updateOwnerOrCoUser(AllScriptDTO allScriptDTO) throws XbbException;

    ScriptVO updatePaymentExplains(UpdatePaymentExplainsDTO updatePaymentExplainsDTO) throws XbbException;

    ScriptVO updateContractExplains(UpdateFundManagemenExpalinstDTO updateFundManagemenExpalinstDTO) throws XbbException;
    /**
     * 修复应收款的数据，把历史被红冲回款金额的应收款需要加上红冲回款金额
     * @param updatePaymentDataDTO
     * @return
     * @throws XbbException
     */
    ScriptVO scriptPaymentData(UpdatePaymentDataDTO updatePaymentDataDTO) throws XbbException;

    /**
     * 修复合同数据的入口
     * @param repairContractDataDTO
     * @return
     * @throws XbbException
     */
    ScriptVO scriptContractData(RepairContractDataDTO repairContractDataDTO) throws XbbException;

    ScriptVO scriptContractSerialNo(RepairContractDataDTO repairContractDataDTO) throws XbbException;

    ScriptVO scriptInvoiceRelationship(FixDataJobDTO fixDataJobDTO) throws XbbException;

    ScriptVO scriptApproveData(FixDataJobDTO fixDataJobDTO) throws XbbException;

    ScriptVO scriptInvoiceAmountData(RepairInvoiceAmountDTO repairInvoiceAmountDTO) throws XbbException;

    /**
     * 处理发票关联关系表内金额为0的情况
     * 注：只能处理无明细那种，有明细的无法处理，多条明细无法追溯各个明细的开票金额
     * @param repairInvoiceAmountDTO
     * @return com.xbongbong.pro.script.pojo.vo.ScriptVO
     * @throws XbbException
     * @author zcp
     * @since v1.0
     * @version v1.0
     */
    ScriptVO repairInvoiceRelationshipMoney(RepairInvoiceAmountDTO repairInvoiceAmountDTO) throws XbbException;

    /**
     * 处理进项发票关联关系表内金额为0的情况
     * 注：只能处理无明细那种，有明细的无法处理，多条明细无法追溯各个明细的开票金额
     * @param repairInvoiceAmountDTO
     * @return com.xbongbong.pro.script.pojo.vo.ScriptVO
     * @throws XbbException
     * @author zcp
     * @since v1.0
     * @version v1.0
     */
    ScriptVO repairPurchaseInvoiceRelationshipMoney(RepairInvoiceAmountDTO repairInvoiceAmountDTO) throws XbbException;

    /**
     * 只修复销项发票关系表的单条数据，修改成正确的money
     * @param repairInvoiceRelationMoneyDTO
     * @return
     * @throws XbbException
     */
    ScriptVO repairInvoiceRelationshipSpecialMoney(RepairInvoiceRelationMoneyDTO repairInvoiceRelationMoneyDTO) throws XbbException;

    ScriptVO repairBatchInvoiceRelationshipMoney(RepairInvoiceRelationMoneyDTO repairInvoiceRelationMoneyDTO) throws XbbException;

    ScriptVO scriptContractInvoiceAmountData(RepairContractBadAmountDTO repairContractBadAmountDTO) throws XbbException;

    ScriptVO scriptContractBadAmount(RepairContractBadAmountDTO repairContractBadAmountDTO) throws XbbException;
    ScriptVO fixProductForm(AllScriptDTO allScriptDTO) throws XbbException;

    ScriptVO repairOneBusinessExplain(AllScriptDTO allScriptDTO, List<AllScriptDTO> allScriptDTOList) throws XbbException;

    FormExplainAddBatchVO fixStockForm(AllScriptDTO allScriptDTO) throws XbbException;

    FieldAttrEntity addNewField(Integer businessType, String attr) throws XbbException;

    ScriptVO scriptParchaseAndPayPlanExplains(UpdateFundManagemenExpalinstDTO updateFundManagemenExpalinstDTO) throws XbbException;

    /**
     * 修复采购合同解释数据
     * @param updateFundManagemenExpalinstDTO
     * @return
     * @throws XbbException
     */
    ScriptVO scriptPurchaseExplains(UpdateFundManagemenExpalinstDTO updateFundManagemenExpalinstDTO) throws XbbException;

    /**
     * 修复付款计划解释数据
     * @param updateFundManagemenExpalinstDTO
     * @return
     * @throws XbbException
     */
    ScriptVO scriptPayPlanExplains(UpdateFundManagemenExpalinstDTO updateFundManagemenExpalinstDTO) throws XbbException;

    /**
     * 更新分组
     * @param updateTabDTO
     * @return
     * @throws XbbException
     */
    ScriptVO scriptPayPlanTab(UpdateTabDTO updateTabDTO) throws XbbException;

    /**
     * 更新付款计划tab栏
     * @param updateTabDTO
     * @return
     * @throws XbbException
     */
    ScriptVO scriptPayPlanDetail(UpdateTabDTO updateTabDTO) throws XbbException;

    ScriptVO fixShowAttrPermission(FixDataJobDTO fixDataJobDTO) throws XbbException;

    /**
     * 修复合同关联产品的售价字段的公式
     *
     * @param fixDataJobDTO
     * @return ScriptVO
     * @throws XbbException
     */
    ScriptVO fixContractProductSellPriceFormula(FixDataJobDTO fixDataJobDTO) throws XbbException;
    ScriptVO fixQuotationProductSellPriceFormula(FixDataJobDTO fixDataJobDTO) throws XbbException;

    ScriptVO repairDepartmentId(RepairDepartmentIdBecauseApiDTO repairDepartmentIdBecauseApiDTO) throws XbbException;

    ScriptVO scriptContractLinkBusinessSingleData(RepairContractDataDTO repairContractDataDTO) throws XbbException;

    ScriptVO repairAddExplainProduct(AllScriptDTO allScriptDTO) throws XbbException;

    ScriptVO scriptContractProcessData(RepairContractDataDTO repairContractDataDTO) throws XbbException;

    ScriptVO repairAddExplainProduct2(AllScriptDTO allScriptDTO) throws XbbException;

    ScriptVO fixContractMemo(FixContractDTO allScriptDTO) throws XbbException;

    ScriptVO fixProductUnit(FixDataJobDTO fixDataJobDTO) throws XbbException;

    ScriptVO addCustomerExplain(AllScriptDTO allScriptDTO) throws XbbException;

    /**
     * 刷工商查询字段：销客对应精线索
     * @param fieldSetDTO
     * @return
     * @throws XbbException
     */
    ScriptVO fineClueMatchSearch(FieldSetDTO fieldSetDTO) throws XbbException;

    ScriptVO addCustomerStage(AllScriptDTO allScriptDTO) throws XbbException;


    ScriptVO repairPerformanceData(RepairContractPerformanceDataDTO performanceDataDTO) throws XbbException;

    ScriptVO repairContractData(RepairContractPerformanceDataDTO performanceDataDTO) throws XbbException;

    ScriptVO addPublicPoolField(AllScriptDTO allScriptDTO) throws XbbException;

    ScriptVO removePublicPoolField(AllScriptDTO allScriptDTO) throws XbbException;

    ScriptVO syncPaymentUser(SyncPaymentUserDTO syncPaymentUserDTO) throws XbbException;

    ScriptVO syncContactUser(SyncContactUserDTO syncContactUserDTO) throws XbbException;
    /**
     * 机会新增竞争对手相关字段：关联竞争对手，赢单竞品
     * date: 2022/8/15 9:13 上午
     * @author yingjf
     * @param allScriptDTO:
     */
    ScriptVO addCompetitor(AllScriptDTO allScriptDTO) throws XbbException;

    /**
     * 移除机会新增的竞争对手相关字段
     * date: 2022/10/20 14:49
     * @author yingjf
     * @param allScriptDTO:
     */
    ScriptVO removeCompetitor(AllScriptDTO allScriptDTO) throws XbbException;
}
